package com.dolo.game.hero
{
	import org.puremvc.as3.multicore.patterns.facade.Facade;
	import com.dolo.game.hero.ApplicationConstants;
	
	import com.dolo.game.hero.shell.controller.StartupCommand;
	public class ApplicationFacade extends Facade
	{
		public function ApplicationFacade( key:String )
		{
			super( key );
		}
		
		public static function getInstance():ApplicationFacade
		{
			if ( instanceMap[KEY] == null )
			{
				instanceMap[KEY] = new ApplicationFacade( KEY );
			}
			return instanceMap[KEY] as ApplicationFacade;
		}
		
		public function startup( app:MainApplication ):void
		{
			super.sendNotification( ApplicationConstants.STARTUP, app );
		}
		
		override protected function initializeController():void 
		{
			super.initializeController();
			
			super.registerCommand( ApplicationConstants.STARTUP, StartupCommand );
		}
		
		private static const	KEY:String	= "ApplicationFacade";
	}
}